<template>
    <view class='head' v-if="show" :style="`opacity:${opacity};`">
        <view class="md" :style="`padding-top: ${top}rpx;`">
            <view class="retu" @click="close" v-if="close_show" style=""> 
                <image  v-if="close_show" src="http://fsl-test.dderp.cn:33548/adh-mini/index/fh.png" mode=""></image>
            </view>
			<view class="home" @click="home" v-if="home_show">
			    <image  v-if="home_show" src="../../static/images/my/home.png" mode=""></image>
			</view>
			<view class="home" @click="back" v-if="back_show">
			    <image  v-if="back_show" src="../../static/images/my/back.png" mode=""></image>
			</view>
            <view :style="titleColor" class="title">
                {{ title }}
            </view>
            <slot name="collect">
            </slot>
            <slot name="order">
            </slot>
        </view>
    </view>
</template>
<script setup>
import { ref, computed } from 'vue'
import { onShow, onLoad } from '@dcloudio/uni-app'
// const props = defineProps(['title', 'show', "opacity", "close_show"])

//background-color: ${bg_color};
const props = defineProps({
    title: {
        type: String,
    },
    show: {
        type: Boolean,
        default: true,
    },
    opacity: {
        type: Number,
        default: 1,
    },
    close_show: {
        type: Boolean,
        default: false,
    },
	home_show: {
	    type: Boolean,
	    default: false,
	},
	back_show: {
	    type: Boolean,
	    default: false,
	},
	bg_color:{
		type: String,
		default: '#03ab91',
	},
  titleColor:{
      type: String,
      default: 'color: #fff'
  }
})
const emit = defineEmits(['close'])
const top = ref(0)
onLoad(() => {
    uni.getSystemInfo({
        success: (e) => {
            top.value = e.statusBarHeight * 2 + 9
        }
    })
})
const close = () => {
    uni.navigateBack({
        delta: 1
    });
}
const home = ()=>{
	uni.navigateTo({
		url:'/pages/tabbar/index/shop/shop_list'
	})
}
const back = ()=>{
	uni.navigateBack();
}
</script>
<style scoped lang="scss">
// 顶部导航栏
.home{
	margin-right:auto;
}

</style> 